package com.yellow.dispatchservice.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yellow.dispatchservice.entity.Vehicle;
import com.yellow.dispatchservice.feign.VehicleFeignService;
import com.yellow.dispatchservice.mapper.VehicleMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class VehicleServiceImpl extends ServiceImpl<VehicleMapper, Vehicle> implements VehicleService {

    @Resource
    private VehicleMapper vehicleMapper;

    @Resource
    private VehicleFeignService vehicleFeignService;
    @Override
    public Vehicle getVehicleByCourierName(String courierName) {

        Integer courierId = vehicleFeignService.getCourierIdByCourierName(courierName);
        System.out.println("courierId = "+courierId);
        return vehicleMapper.getVehicleByCourierId(courierId);
    }
}
